﻿using StarsAdmin.Core.Attributes;
using StarsAdmin.Core.Enums;
using System.ComponentModel.DataAnnotations;

namespace StarsAdmin.Application.User.Dtos
{
    public class AddUserInput
    {
        /// <summary>
        ///  用户真实姓名
        /// </summary>

        public string? Name { get; set; }

        /// <summary>
        /// 用户名称
        /// </summary>
        [Required(ErrorMessage = "userName 字段是必须的")]
        public string UserName { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        public string? NickName { get; set; }

        /// <summary>
        /// 用户密码
        /// </summary>
        public string? Password { get; set; }

        /// <summary>
        /// 用户密码
        /// </summary>
        [Compare(nameof(Password), ErrorMessage = "确认密码和密码不一致")]
        public string? ConfirmPassword { get; set; }

        /// <summary>
        /// 用户描述
        /// </summary>
        public string? Description { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [Required(ErrorMessage = "email 字段是必须的")]
        [EmailAddress(ErrorMessage = "电子邮箱地址格式不正确")]
        public string Email { get; set; }

        /// <summary>
        /// 电话号码
        /// </summary>
        [Required(ErrorMessage = "phoneNumber 字段是必须的")]
        [PhoneNumber(ErrorMessage = "手机号码格式不正确")]
        public string PhoneNumber { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        public string? Avatar { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public GenderEnum? Gender { get; set; }

        /// <summary>
        /// 年龄
        /// </summary>
        public int? Age { get; set; }

        /// <summary>
        /// 地址
        /// </summary>
        public string[]? Address { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; }

        /// <summary>
        /// 角色id
        /// </summary>
        public long[]? RoleIds { get; set; }
    }
}